package com.sloth.bear.constant;

public enum ResultCode {
    
    SUCCESS(200, "操作成功"),
    
    BAD_REQUEST(400, "请求参数错误"),
    UNAUTHORIZED(401, "未授权"),
    FORBIDDEN(403, "禁止访问"),
    NOT_FOUND(404, "资源不存在"),
    
    ERROR(500, "系统内部错误"),
    VALIDATION_ERROR(502, "数据校验失败"),
    
    DOCUMENT_NOT_FOUND(1001, "文档不存在"),
    DOCUMENT_CREATE_FAILED(1002, "文档创建失败"),
    DOCUMENT_UPDATE_FAILED(1003, "文档更新失败"),
    DOCUMENT_DELETE_FAILED(1004, "文档删除失败");
    
    private final Integer code;
    private final String message;
    
    ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
    
    public Integer getCode() {
        return code;
    }
    
    public String getMessage() {
        return message;
    }
}